﻿using AutoMapper;
using King.AdminSite.Models;
using King.Data;
using King.Helper;
using King.Repository;
using log4net;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace King.AdminSite.Controllers
{
    public class HomeController : Controller
    {
        private ILog log = LogManager.GetLogger(Startup.logRepository.Name, typeof(HomeController));
        private ICacheService _cache;
        private IMapper _mapper;
        private IRepository<SiteConfig> _siteRepository;
        private IRepository<Tags> _tagsRepository;
        private IRepository<Article> _articleRepository;


        public HomeController(ICacheService cache, IMapper mapper,
              IRepository<SiteConfig> siteRepository,
             IRepository<Tags> tagsRepository,
             IRepository<Article> articleRepository

           )
        {
            _cache = cache;
            _mapper = mapper;
            _siteRepository = siteRepository;
            _tagsRepository = tagsRepository;
            _articleRepository = articleRepository;

        }

        /// <summary>
        /// 导航缓存键
        /// </summary>
        public const string CACHE_NVATGATION = "CACHE_NVATGATION";
        /// <summary>
        /// 网站信息
        /// </summary>
        public const string CACHE_SITEINFO = "CACHE_SITEINFO";


        //public async Task<IActionResult> Index(string path, int id = 0)
        //{
        //    return View();
        //}


        [ActionName("404")]
        public IActionResult Error()
        {
            return View();
        }

    }
}
